package com.ruoyi.service.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.enums.YesNoEnum;
import com.ruoyi.service.user.entity.LaborExtEntity;
import com.ruoyi.service.user.mapper.LaborExtMapper;
import com.ruoyi.service.user.service.LaborExtService;
import java.util.List;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 制作方信息 服务实现类
 * </p>
 *
 * @author zhanglianbao
 * @since 2025-10-03
 */
@Service
public class LaborExtServiceImpl extends ServiceImpl<LaborExtMapper, LaborExtEntity>
    implements LaborExtService {

  @Override
  public List<LaborExtEntity> listByUserIds(List<Long> userIds) {
    final LambdaQueryWrapper<LaborExtEntity> query = effectQuery()
        .in(LaborExtEntity::getUserId, userIds);
    return list(query);
  }

  @Override
  public LaborExtEntity getByUserId(Long userId) {
    final LambdaQueryWrapper<LaborExtEntity> query = effectQuery()
        .eq(LaborExtEntity::getUserId, userId);
    return getOne(query);
  }

  private LambdaQueryWrapper<LaborExtEntity> effectQuery() {
    return new LambdaQueryWrapper<LaborExtEntity>().eq(LaborExtEntity::getDelFlag,
        YesNoEnum.NO.getCode());
  }
}
